using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using Yoozoo.UI;
public class YSliderBinderTreeItem : BindingBinderTreeItemBase
{
    public static Dictionary<YSliderBinder.AttributeType, LinkerValueState> AttributeValueDic = new Dictionary<YSliderBinder.AttributeType, LinkerValueState>
    {
        {YSliderBinder.AttributeType.tween, LinkerValueState.Boolean},
        {YSliderBinder.AttributeType.tweenDuration, LinkerValueState.Single},
        {YSliderBinder.AttributeType.onTweenComplete, LinkerValueState.UnityEvent2},
        {YSliderBinder.AttributeType.minValue, LinkerValueState.Single},
        {YSliderBinder.AttributeType.maxValue, LinkerValueState.Single},
        {YSliderBinder.AttributeType.wholeNumbers, LinkerValueState.Boolean},
        {YSliderBinder.AttributeType.value, LinkerValueState.Single},
        {YSliderBinder.AttributeType.normalizedValue, LinkerValueState.Single},
        {YSliderBinder.AttributeType.onValueChanged, LinkerValueState.UnityEventSingle},
        {YSliderBinder.AttributeType.interactable, LinkerValueState.Boolean},
        {YSliderBinder.AttributeType.enabled, LinkerValueState.Boolean},
    };
    public YSliderBinderTreeItem() : base(typeof(YSliderBinder))
    {
    }
    
    public override void RebuildTree()
    {
        base.RebuildTree();
        foreach (YSliderBinder.AttributeType binderType in Enum.GetValues(typeof(YSliderBinder.AttributeType)))
        {
            BindingLinkerTreeItem linkerTreeItem = new BindingLinkerTreeItem(binderType.ToString(), binderType.ToString(), (int)AttributeValueDic[binderType]);
            AddChild(linkerTreeItem);
        }
    }
}